package org.yagnus.stats.sampler.discrete;

import java.util.List;
import org.yagnus.stats.sampler.Sampler;

/**
 * 
 * @author hc.busy
 * 
 * @param <T>
 */
public abstract class StreamSampler<T> extends Sampler {

    /**
     * 
     * This method is the interface with which we feed the sampler Implementor should take into
     * account that this will possibly be called asynchronously.
     * 
     * @param t
     *            the sample we just saw
     * @param w
     *            the weight of this item
     * 
     * 
     */
    public abstract void observe(T t, double w);

    /**
     * 
     * This returns the current state of this sampler's result as if the the input stream ended just
     * now.
     * 
     * @return
     */
    public abstract List<T> currentSample();

}
